package com.zfzs.post.modules.finance.rest;

import com.zfzs.post.aop.log.Log;
import com.zfzs.post.common.bean.ResponseResult;
import com.zfzs.post.modules.finance.service.BenefitWebService;
import com.zfzs.post.modules.transaction.service.dto.BenefitDayQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author wq
 * @date 2019/12/4 17:34
 * @description
 */
@RestController
@RequestMapping("benefit")
public class BenefitWebController {

    @Autowired
    private BenefitWebService benefitWebService;



    @Log("分页查询分润")
    @GetMapping("/list")
    @PreAuthorize("hasAnyRole('ADMIN','POSTTERMINALINFO_ALL','POSTTERMINALINFO_SELECT')")
    public ResponseResult getBenefitPage(BenefitDayQueryCriteria criteria, Integer page, Integer size){
        Map<String, Object> map = benefitWebService.getBenefitPage(criteria, page, size);
        return ResponseResult.ok(map);
    }


}
